<!--个人空间-->
<div class="card border-0 rounded-6 px-3 mb-2 mb-md-3 d-none d-lg-block" id="home-card">
    <div class="card-header bg-none px-0">
        <strong><i class="fa fa-flag mr-2 f-17"></i>公众号</strong>
        <img class="float-right" id="theme-img"
            src="{{ url_for('main.static',filename='img/toggle-dark.png') if request.cookies.get('toggleTheme') == 'dark' else url_for('main.static',filename='img/toggle-light.png') }}"
            alt="theme-toggle" title="切换主题" data-darkico="{{url_for('main.static', filename='img/toggle-dark.png')}}"
            data-lightico="{{url_for('main.static', filename='img/toggle-light.png')}}"
            data-darkcss="{{url_for('main.static', filename='css/night.css')}}">
    </div>
    <div class="card-body px-0 pb-1">
        <div class="text-center">
            <img class="rounded" style="width: 90%; height: 90%;"
                src="{{url_for('.static',filename='img/qrcode_for_hesanbiji.jpg')}}">
        </div>
    </div>
</div>
<!--文章分类-->
<div class="card border-0 rounded-6 px-3 mb-2 mb-md-3card border-0 rounded-6 px-3 mb-2 mb-md-3" id="category-card">
    <div class="card-header bg-none px-0">
        <strong><i class="fa fa-book mr-2 f-17"></i>专题</strong>
    </div>

    <ul class="list-group list-group-flush f-16">
        {% for c in get_categorys_by_parent() %}
        <li class="list-group-item d-flex justify-content-between align-items-center pr-2 py-2">
            <a class="category-item" href="{{url_for('main.category',c=c.name)}}"
                title="查看【{{c.title}}】分类下所有文章">{{c.title}}</a>
            <span class="badge text-center">{{c.articles_count()}}</span>
        </li>
        {% endfor %}

    </ul>
</div>
<!--标签云-->
<div class="card border-0 rounded-6 px-3 mb-2 mb-md-3" id="tag-card">
    <div class="card-header bg-none px-0">
        <strong><i class="fa fa-tags mr-2 f-17"></i>标&nbsp;签&nbsp;云</strong>
    </div>
    <div class="card-body px-0 py-3">
        <div class="tag-cloud">
            {% for t in get_tags() %}
            <a href="{{url_for('.tag', t=t.code)}}" class="tags f-16" id="tag-{{t.id}}"
                title="{{t.name}}">{{t.name}}</a>
            {% endfor %}
        </div>
    </div>
</div>
<!--最新文章-->
<div class="card border-0 rounded-6 px-3 mb-2 mb-md-3" id="new-card">
    <div class="card-header bg-none px-0">
        <strong><i class="fa fa-book mr-2 f-17"></i>最新文章</strong>
    </div>
    <ul class="list-group list-group-flush f-16">
        {% for a in get_articles(per_page=10) %}
        <li class="list-group-item d-flex justify-content-between align-items-center pr-2 py-2">
            <a class="category-item" href="{{url_for('main.article',name=a.name)}}" title="{{a.title}}">{{a.title |
                truncate(28,killwords=True,leeway=0) }}</a>
            <span class="badge text-center"></span>
        </li>
        {% endfor %}

    </ul>
</div>

<!--友情链接-->

<div class="card border-0 rounded-6 px-3 mb-2 mb-md-3" id="friends-card">
    <div class="card-header bg-none px-0">
        <strong><i class="fa fa-link mr-2 f-17"></i>友情链接</strong>
    </div>
    <div class="card-body px-0 py-3">
        <div class="tool-list">

            {% for f_link in get_friendlylinks() %}
            <div class="w-50 float-left text-center mb-2">
                <div class="mx-2">
                    <a href="{{f_link.link}}" title="f_link.name" target="_blank">{{f_link.name}}</a>
                </div>
            </div>
            {% endfor %}

        </div>
    </div>
</div>